<?php

/*
 * To change this license header, choose License Headers in Project Properties.
 * To change this template file, choose Tools | Templates
 * and open the template in the editor.
 */

/**
 * Description of ConsoleLog
 *
 * @author Administrator
 */
class ConsoleLogUtil {

    //put your code here
    public static function debug($data) {
        if (is_array($data)) {
            $output = "<script>console.log( 'Debug " . get_class($data) . ": " . implode(',', $data) . "' );</script>";
        } else {
            $output = "<script>console.log( 'Debug " . get_class($data) . ": " . $data . "' );</script>";
        }
        echo $output;
    }

    public static function info($data) {
        if (is_array($data)) {
            $output = "<script>console.log( 'Info " . get_class($data) . ": " . implode(',', $data) . "' );</script>";
        } else {
            $output = "<script>console.log( 'Info " . get_class($data) . ": " . $data . "' );</script>";
        }
        echo $output;
    }

    public static function error($data) {
        if (is_array($data)) {
            $output = "<script>console.log( 'Error " . get_class($data) . ": " . implode(',', $data) . "' );</script>";
        } else {
            $output = "<script>console.log( 'Error " . get_class($data) . ": " . $data . "' );</script>";
        }
        echo $output;
    }

}
